<?php
session_start();
include('inc/config.php');
?>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="Hasan" content="EC" />
        <!--  CSS   -->
        <link href="css/en/mycss.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/header.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/footer.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/userProfile.css" rel="Stylesheet" type="text/css" />
        <link href="css/en/admin.css" rel="Stylesheet" type="text/css" />
        <link rel="shortcut icon" href="favicon.ico" />
        <!--  JS   -->
        <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
        <script src="js/myjs.js"></script>
        <script src="js/userProfile.js"></script>
        <script src="js/header.js"></script>

        <title>Mobizoo Mobiles</title>
    </head>

    <!-- BODY -->
    <body>
        <div id="addingProduct">
            <p>processing...</p>
            <img src="images/loading.gif"/>
        </div>
        <div id="successAdding">
            <p>Success :D</p>
            <img width="40px" src="images/added.png"/>
        </div>
        
        <!-- ********************************* -->
        <!-- header -->
        <!-- ********************************* -->
        <?php
        include('inc/header.php');
        ?>

        <!-- ********************************* -->
        <!-- Cart -->
        <!-- ********************************* -->

        <div id="userProfileArea">
            <div id="userProfileAreaStatistics">
                <?php
//                $totalBought = 0;
//                $totalCash = 0;
//                $totalSpentCash = 0;
//                $userID = $_SESSION['userID'];
//                $query="SELECT * from bought_product WHERE userID= $userID";
//                $result = mysql_query($query);
//                while($row = mysql_fetch_array($result)){
//                    $totalBought+=$row['quantity'];
//                }
                ?>
                <?= '<p>' . $_SESSION['name'] . ' ' . $_SESSION['lname'] . '</p>' ?>
            </div>
            <div id="userProfileAreaInput">
                <div id="userProfileAreaInputCredit">
                    <p>Credit Card</p>
                    <?php
                    $sql = "SELECT * FROM `user` WHERE id = " . $_SESSION['id'] . "";
                    $result = mysql_query($sql);
                    $row = mysql_fetch_array($result);
                    echo '<input type="text" id="creditInput" content="'.$_SESSION['id'].'" value="'.$row['credit'].'" size="50px"/>';
                    ?>
                    <input type="button" id="UpdateCredit" style="background-color: #0080FF; border: none; padding: 2px; border-radius:2px; color: white;" value="Update"/>
                </div>
                <div id="userProfileAreaInputPassword">
                    <p> Password :   </p>
                    <?php
                    $sql = "SELECT * FROM `user` WHERE id = " . $_SESSION['id'] . "";
                    $result = mysql_query($sql);
                    $row = mysql_fetch_array($result);
                    echo '<input type="text" id="passwordInput" content="'.$_SESSION['id'].'"  value="'.$row['password'].'" size="50px"/>';
                    ?>
                    <input type="button" id="UpdatePassword" style="background-color: #0080FF; border: none; padding: 2px; border-radius:2px; color: white;" value="Update"/>
                </div>
            </div>
        </div>

        <!-- ********************************* -->
        <!-- footer -->
        <!-- ********************************* -->
        <?php
        include('inc/footer.php');
        ?>

    </body>
</html>